home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / amos / amcafext.lha / AMCAF_Examples / ShadeBobs1.AMOS / ShadeBobs1.amosSourceCode
AMOS Source Code  |  1995-07-14  |  3KB  |  63 lines

  1. ' ************************************* Commands used: 
  2. ' *                                   * Fcircle            Shade Bob Planes
  3. ' *           Amcaf Examples          * Shade Bob Up       =Qrnd 
  4. ' *         Shade Bobs 1 V1.1         * =Qsin
  5. ' *      Written by Chris Hodges      * =Qcos
  6. ' *                                   * Blitter Copy Limit 
  7. ' ************************************* Blitter Copy 
  8. '                          
  9. ' Remove the mousepointer from screen. 
  10. Hide 
  11. ' First open a little screen to draw one bob 
  12. Screen Open 0,32,32,2,Lowres
  13. Curs Off : Flash Off : Paper 0 : Pen 1 : Cls 
  14. ' We don't want the user to see the drawing process, so we hide the screen.
  15. Screen Hide 
  16. ' Draw a filled circle and grab it out.  
  17.  Extension_8_05E6 7,7,7
  18. Get Bob 1,0,0 To 14,14
  19. Hot Spot 1,7,7
  20. ' Now we open the screen, we want to draw the shade bobs on. 
  21. ' This screen should have many colours, and must be single buffered. 
  22. ' Extra halfbright is used to enable another nice effect.
  23. Screen Open 0,320,256,64,Lowres
  24. Curs Off : Flash Off : Paper 0 : Pen 1 : Cls 
  25. ' Create a nice looking palette. 
  26. For A=0 To 7 : Colour A,A*$20 : Next 
  27. For A=0 To 7 : Colour A+8,A*$201+$F0 : Next 
  28. For A=0 To 7 : Colour A+16,$FF8-A*$20 : Next 
  29. For A=0 To 7 : Colour A+24,$F08-A*$201 : Next 
  30. ' We don't want plane 5 (the plane for extra halfbright) to be cycled. 
  31. ' So set the number of planes to 5.
  32.  Extension_8_0F6C 5
  33. ' We want to have a *nice* logo in the background. 
  34. Load Iff "Data/IntelOutside.iff",1
  35. Screen Hide 
  36. ' We copy the logo into the extra halfbright plane.
  37.  Extension_8_128A 1
  38.  Extension_8_12B2 1,0 To 0,5
  39. ' Now we don't need that screen any longer.
  40. Screen Close 1
  41. ' These are the three angles, we use to create some sine flying path.  
  42. W1=0 : W2=512 : W3=256
  43. ' I is again an image pointer, and T is to count the frames. 
  44. I=1 : T=0
  45. Repeat 
  46.   ' Wait Vbl to sychronisize to the raster beam. 
  47.   Wait Vbl 
  48.   ' Move the two points by adding something to the angles. 
  49.   Add W1,10
  50.   Add W2,9
  51.   Add W3,3+ Extension_8_11B8(1)
  52.   ' Calculate two coordinates. 
  53.   X1= Extension_8_1106(W1+W3, Extension_8_1114(W2,160))+160 : Y1= Extension_8_1114(W3, Extension_8_1106(W1-W3,128))+128
  54.   X2= Extension_8_1114(W3-W2, Extension_8_1106(W3,160))+160 : Y2= Extension_8_1106(W1, Extension_8_1114(W2-W3,128))+128
  55.   ' Draw a line of shade bobs between these two coordinates. 
  56.   For A=0 To 4
  57.     X=((X1*A)+(X2*(4-A)))/4
  58.     Y=((Y1*A)+(Y2*(4-A)))/4
  59.      Extension_8_0F84 0,X,Y,1
  60.   Next 
  61. Until Inkey$=Chr$(27) or Mouse Key<>0
  62. Screen Close 0
  63. End